package cn.com.chengmandian.bike.constants;

/**
 * Description: cmd-bike-user
 * <p>
 * Created by asus on 2022/5/17 15:55
 */
public enum ScanRecordTypeEnum {

    NORMAL(1, "正常",200),
    NOT_PUT(2, "未投放",508),
    USE_RIDE(3, "使用中",509),
    CLOSE_SOC(4,"缺电",510),
    OUTSIDE_AREA(5,"运营区外",511),
    NO_ONLINE(6,"离线",512),
    NO_NEARBY(7,"超出%s米",513),
    NO_LOGIN(8,"未登录",507),
    USER_BLACK(9,"账号拉黑",506),
    NO_DEPOSIT_CARD(10,"未购买免押卡 或 缴纳押金",502),
    NO_BALANCE(11,"余额不足",503),
    ORDER_NO_FINISH(12,"订单未完成",504),
    ORDER_NO_PAY(13,"订单未支付",505),
    NO_AUTH(14,"未实名认证",501),
    SHUTDOWN(15,"电单车停运",514),
    PRODUCTION(16, "车辆状态生产中", 5080),
    NOT_RELEASED(17, "车辆状态未投放", 5081),
    STOP(18, "车辆状态暂停中", 5083),
    BACK(19, "车辆状态待拖回", 5084),
    DISABLE_SHARE(20, "未开启共享运营", 521),
    REPAIR(21, "车辆状态维修中", 5085),
    WAIT_DISPATCH(22, "车辆状态待调度", 5086),
    DISPATCH(23, "车辆状态调度中", 5087),
    SCRAP(24, "车辆状态已报废", 5088),
    LOSE(25, "车辆状态已丢失", 5089),
    WAIT_REPAIR(26, "车辆状态待维修", 50810);


    private Integer code;

    private String name;

    private Integer errCode;

    public Integer getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public Integer getErrCode(){return this.errCode;}

    public static ScanRecordTypeEnum getByErrCode(Integer errCode){
        if(errCode == null){
            return null;
        }else{
            ScanRecordTypeEnum[] values = values();
            for(ScanRecordTypeEnum scanRecordTypeEnum :values){
                if(scanRecordTypeEnum.getErrCode().equals(errCode)){
                    return scanRecordTypeEnum;
                }
            }
        }
        return null;
    }

    ScanRecordTypeEnum(Integer code, String name, Integer errCode) {
        this.code = code;
        this.name = name;
        this.errCode = errCode;
    }
}
